#ifndef WELCOMEANIMATION_H
#define WELCOMEANIMATION_H

#include "gui.h"

class DesktopResource;
class Resource;
class QPropertyAnimation;
class QThread;

class WelcomeAnimation : public GUI
{
    Q_OBJECT
    Q_PROPERTY(int index READ index WRITE setIndex)

public:
    WelcomeAnimation(int w, int h);
    QRectF boundingRect() const;
    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
    void keyPressEvent(QKeyEvent *event);

    int index() const { return indexForAnimation; }
    void setIndex(int index);

    void welcome();
    QPropertyAnimation *startAnimation(int duration);
private slots:
    void team();
    void finishAnimation();

private:
    DesktopResource *desktopResource;
    Resource *resource;
    int width;
    int height;
    QPixmap *backgroundPixmap;

    QList<QPixmap *> *welcomeList;
    QList<QPixmap *> *teamList;
    QList<QPixmap *> *currentList;
    int indexForAnimation;
    QPropertyAnimation *animation;

    QThread *thread1;
};

#endif // WELCOMEANIMATION_H
